
package jpoco.internal.gson;

import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;

import java.lang.reflect.Type;

import jpoco.client.Relationship;

public class RelationshipTypeAdapter
    implements JsonDeserializer<Relationship> 

{

    
    public RelationshipTypeAdapter() 
    {
    	// empty
    }
    


    public Relationship deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
        throws JsonParseException 
    {
    	
    	
      if (!(json instanceof JsonPrimitive)) 
      {
         throw new JsonParseException("should be a string value");
      }

      String s = json.getAsString();
      
      return new Relationship(s);
    }
    
}
